<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
>

<!-- 导入公有的header -->
<head th:include="common/head::header"/>


<body class="hold-transition skin-blue sidebar-mini">
    <!-- =============================================== -->
    <!-- Main content -->
    <section class="content">

        <div class="row">
            <div class="col-md-12">


                        <!-- radio -->
                        <div class="form-group">
                                <label>
                                    <input type="radio" name="videoPlayerType"  value="ALL" th:checked="${vlcIsRun==false && xLPlayerIsRun==false }">
                                    通用类型
                                </label>
                                <label th:if="${IS_MAC_OS==true}">
                                    <input type="radio" name="videoPlayerType"  value="MAC_VLC" th:checked="${vlcIsRun==true}" >
                                    MAC系统的VLC播放器
                                </label>
                                <label th:if="${IS_MAC_OS==true}">
                                    <input type="radio" name="videoPlayerType"  value="MAC_XUNLEI" th:checked="${xLPlayerIsRun==true}">
                                    MAC系统的迅雷影音
                                </label>
                                <label th:if="${IS_WIN_OS==true}">
                                    <input type="radio" name="videoPlayerType" value="WIN_POT_PLAYER" th:checked="${potPlayerIsRun==true}">
                                    Windows 完美解码
                                </label>
                                <label th:if="${IS_WIN_OS==true}">
                                    <input type="radio" name="videoPlayerType"  value="WIN_XUNLEI">
                                    Windows 迅雷影音
                                </label>
                                <label th:if="${IS_WIN_OS==true}">
                                    <input type="radio" name="videoPlayerType"  value="WIN_VLC">
                                    Windows VLC
                                </label>
                        </div>


                <Irca:ircaButton text="播放器音量" onclick="playerVolumeReduce();" ico="fa fa-volume-down" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="播放器音量" onclick="playerVolumeAdd();" ico="fa fa-volume-up" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="播放/暂停" onclick="playOrStop();" ico="fa  fa-play" continuity="false" class="btn btn-block btn-success btn-lg"></Irca:ircaButton>


                <Irca:ircaButton text="快退" onclick="speedReduce();" ico="fa  fa-angle-double-left" continuity="true" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="快进" onclick="speedAdd();" ico="fa  fa-angle-double-right" continuity="true" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>



                <Irca:ircaButton text="静音/有声" onclick="playerMuteReduce();" keyword="M" ico="fa  fa-bell-slash-o" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>


                <Irca:ircaButton text="全屏/恢复" onclick="fullScreenReduce();" keyword="Ctrl+Enter" ico="fa fa-object-ungroup" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>


                <Irca:ircaButton text="上一个" onclick="previous();" ico="fa fa-arrow-left" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="下一个" onclick="next();" ico="fa fa-arrow-right" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="系统音量+" onclick="systemVolumeAdd();" ico="fa fa-volume-up" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="系统音量-" onclick="systemVolumeReduce();" ico="fa fa-volume-down" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="画面截屏" onclick="screenShot();" ico="fa fa-video-camera" continuity="false" class="btn btn-block btn-warning btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="窗口为视频一半" onclick="playerWinSizeHalfCmd();" ico="fa fa-object-ungroup" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="窗口适合屏幕大小" onclick="playerWinSizeFitCmd();" ico="fa fa-object-group" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="切换声道" onclick="playerSoundChanelCmd();" ico="fa fa-headphones" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="切换字幕轨道" onclick="playerSubtitleCmd();" ico="fa fa-tasks" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="退出播放程序" onclick="exitPlayer();" ico="fa fa-power-off" continuity="false" class="btn btn-block btn-danger btn-lg"></Irca:ircaButton>


                    </div>
                    <!-- /.box -->

            <!-- /.col -->
        </div>

    </section>
    <!-- /.content -->
    <script type="application/javascript">
        //播放，暂停
        function playOrStop(){
            parent.sendVideoCmd('PLAY_STOP_CMD','-1',getVideoPlayerTypeSelect());
        }
        //快进
        function speedAdd(){
            parent.sendVideoCmd('SPEED_ADD_CMD','-1',getVideoPlayerTypeSelect());
        }
        //快退
        function speedReduce(){
            parent.sendVideoCmd('SPEED_REDUCE_CMD','-1',getVideoPlayerTypeSelect());
        }
        //播放器的音量+
        function playerVolumeAdd(){
            parent.sendVideoCmd('PLAYER_VOLUME_ADD_CMD','-1',getVideoPlayerTypeSelect());
        }
        //播放器的音量-
        function playerVolumeReduce(){
            parent.sendVideoCmd('PLAYER_VOLUME_REDUCE_CMD','-1',getVideoPlayerTypeSelect());
        }
        //静音与解除静音
        function playerMuteReduce(){
            parent.sendVideoCmd('MUTE_CMD','-1',getVideoPlayerTypeSelect());
        }
        //全屏与解除全屏
        function fullScreenReduce(){
            parent.sendVideoCmd('FULLSCREEN_CMD','-1',getVideoPlayerTypeSelect());
        }
        //下一个
        function next(){
            parent.sendVideoCmd('NEXT_CMD','-1',getVideoPlayerTypeSelect());
        }
        //上一个
        function previous(){
            parent.sendVideoCmd('PREVIOUS_CMD','-1',getVideoPlayerTypeSelect());
        }
        //画面截屏
        function screenShot(){
            parent.sendVideoCmd('PLAYER_SCREEN_SHOT_CMD','-1',getVideoPlayerTypeSelect());
        }
        //退出播放器
        function exitPlayer(){
            parent.sendVideoCmd('EXIT_PLAYER_CMD','-1',getVideoPlayerTypeSelect());
        }

        //系统的音量+
        function systemVolumeAdd(){
            parent.sendVideoCmd('SYSTEM_VOLUME_ADD_CMD','-1',getVideoPlayerTypeSelect());
        }
        //系统的音量-
        function systemVolumeReduce(){
            parent.sendVideoCmd('SYSTEM_VOLUME_REDUCE_CMD','-1',getVideoPlayerTypeSelect());
        }


        //播放窗口一半大小
        function playerWinSizeHalfCmd(){
            parent.sendVideoCmd('PLAYER_WIN_SIZE_HALF','-1',getVideoPlayerTypeSelect());
        }
        //播放窗口适合屏幕
        function playerWinSizeFitCmd(){
            parent.sendVideoCmd('PLAYER_WIN_SIZE_FIT','-1',getVideoPlayerTypeSelect());
        }

        //切换声道
        function playerSoundChanelCmd(){
            parent.sendVideoCmd('PLAYER_SOUND_CHANEL','-1',getVideoPlayerTypeSelect());
        }

        //切换字幕轨道
        function playerSubtitleCmd(){
            parent.sendVideoCmd('PLAYER_CHANGE_SUB_TITLE','-1',getVideoPlayerTypeSelect());
        }


        /**
         * 获取播放器被选中的类型
         * @returns {*|define.amd.jQuery}
         */
        function  getVideoPlayerTypeSelect(){
           return $("input[name='videoPlayerType']:checked").val();
        }




    </script>
</body>
</html>
